﻿@model ESupervision.ViewModels.StudentActivitiesVM
@{
    ViewBag.Title = "Student Activities";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Student Activities</h2>
<p>
    @Html.ActionLink(" Back to list", "TeacherDashboard", null, new { @class = "btn btn-success btn-sm glyphicon glyphicon-repeat" })
</p>
<div class="row">
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title" id="panel-title">Your Student Activities<a class="anchorjs-link" href="#panel-title"><span class="anchorjs-icon"></span></a></h3>
        </div>
        <div class="panel-body">
            <div role="tabpanel">

                <!-- Nav tabs -->
                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation" class="active"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">Profile</a></li>
                    <li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">Messages</a></li>
                    <li role="presentation"><a href="#documents" aria-controls="documents" role="tab" data-toggle="tab">Documents</a></li>
                </ul>

                <!-- Tab panes -->
                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane active" id="profile">
                        <div class="list-group">
                            <a href="#" class="list-group-item">
                                <strong>Fist Name: </strong>@Model.StaticStudent.FirstName
                            </a>
                            <a href="#" class="list-group-item">
                                <strong>Full Name: </strong>@Model.StaticStudent.FullName
                            </a>
                            <a href="#" class="list-group-item">
                                <strong>Birthday: </strong>@Html.DisplayFor(model => model.StaticStudent.Birthday)
                            </a>
                            <a href="mailto:@Model.StaticStudent.Email" class="list-group-item">
                                <strong>Email: </strong>@Model.StaticStudent.Email
                            </a>
                            <a href="#" class="list-group-item">
                                <strong>Phone: </strong>@Model.StaticStudent.Phone
                            </a>
                            <a href="#" class="list-group-item">
                                <strong>Enrollment Date: </strong>@Html.DisplayFor(model => model.StaticStudent.EnrollmentDate)
                            </a>
                            <a href="#" class="list-group-item">
                                <strong>Fullname Supervisor: </strong>@Html.DisplayFor(model => model.StaticStudent.Supervisor.FullName)
                            </a>
                            <a href="#" class="list-group-item">
                                <strong>Fullname Second Marker: </strong>@Html.DisplayFor(model => model.StaticStudent.SecondMarker.FullName)
                            </a>
                        </div>
                    </div>
                    <div role="tabpanel" class="tab-pane" id="messages">
                        <div class="list-group">
                            @foreach (var item in Model.MessageRecipients)
                            {
                                if (item.MessageStatus == ESupervision.Models.MessageStatus.Unread)
                                {
                                    <a href="@Url.Action("Read", "Message", new { id = item.MessageID, rId = item.MessageID })" class="list-group-item">
                                        <b>@item.Message.Subject</b> <span class="badge">Received Message</span>
                                    </a>
                                }
                                else
                                {
                                    <a href="@Url.Action("Read", "Message", new { id = item.MessageID, rId = item.MessageID })" class="list-group-item">
                                        @item.Message.Subject <span class="badge">Received Message</span>
                                    </a>
                                }
                            }
                        </div>
                    </div>
                    <div role="tabpanel" class="tab-pane" id="documents">
                        <div class="list-group">
                            @foreach (var item in Model.Documents)
                            {
                                <a href="@Url.Action("Details", "Document", new { id =item.DocumentID})" class="list-group-item">
                                    @item.Subject
                                    @if (item.Comments.Count > 0 && item.Comments.Last().CommentTime > DateTime.Now.AddDays(-1))
                                    {
                                        <span class="badge">New Uploaded File And Comments</span>
                                    }
                                    else
                                    {
                                        <span class="badge">New Uploaded File</span>
                                    }
                                </a>
                            }
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
